Simulation method for milling by use of dynamic position error

ABSTRACT

A simulation method for milling by use of a dynamic position error includes the steps of: (a) generating a milling surface from a numerical control code, the milling surface having a plurality of grid points, the numerical control code having a position command; (b) calculating a normal vector for each of the plurality of grid points on the milling surface; (c) feeding back a position feedback of each of the plurality of grid points by the controller of the machine tool, and deriving a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback; (d) calculating a component of the normal vector for the three-axis dynamic position error so as to obtain a normal-vector error value of the corresponding grid point; and, (e) displaying undercutting information of the normal-vector error value of the corresponding grid point on the milling surface.

CROSS REFERENCE TO RELATED APPLICATION

This application claims the benefits of Taiwan application Serial No. 107142443, filed on Nov. 28, 2018, the disclosures of which are incorporated by references herein in its entirety.

TECHNICAL FIELD

The present disclosure relates in general to a simulation method for milling, and more particularly to a simulation method for milling by use of a dynamic position error.

BACKGROUND

In the art of conventional machining simulations, if an effect of errors upon the model surface is to be estimated, CAD/CAM software such as NX, CATIA, VERICUT and the like, is usually applied. Generally, while in simulating the machining by the CAD/CAM software, numerical control codes are inputted into the corresponding machine tool to define a machining path for a cutting tool to follow and a material of workpiece to be removed by the cutting tool is defined by the intersection of the workpiece and the cutting tool. Thereupon, the simulation of machining can thus be performed.

As described above, the CAD/CAM software generally applies the numerical control code to simulate largely the machining. In other words, the conventional calculation of the material to be removed during the simulation is mainly to follow the machining path defined by the numerical control code inputted to the machine tool. In this calculation, it is concerned only if the cutting tool is interfered in the machine tool during the simulation, or the height of material left in the simulated milling surface. Apparently, dynamic factors to cause simulation errors such as the control, the interpolation technique or the structuring of the machine tool are not taken into consideration. Thus, in the conventional simulation upon machining by using CAD/CAM software, these dynamic errors that cause defects on the milling surface are not considered, and the calculation on the material to be removed usually costs plenty of time.

SUMMARY

An object of the present disclosure is to provide a simulation method for milling by use of a dynamic position error, which utilizes a projected normal vector on a milling surface from a three-axis dynamic position error to simulate undercutting. Except that the defects on the milling surface caused by dynamic errors can be really presented, simulation time can be also reduced.

Another object of this present disclosure is to provide a simulation method for milling by use of a dynamic position error that is applicable for connecting a controller of a machine tool. This simulation method includes the steps of: (a) generating a milling surface from a numerical control code, the milling surface having a plurality of grid points, the numerical control code having a position command; (b) calculating a normal vector for each of the plurality of grid points on the milling surface; (c) feeding back a position feedback of each of the plurality of grid points by the controller of the machine tool, and deriving a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback; (d) calculating a component of the normal vector for the three-axis dynamic position error so as to obtain a normal-vector error value of the corresponding grid point; and, (e) displaying undercutting information of the normal-vector error value of the corresponding grid point on the milling surface.

A further object of the present disclosure is to provide a simulation method for milling by use of a dynamic position error that is applicable to connect a machine tool further connecting an electromechanical analysis module. This simulation method includes the steps of: (a) generating a milling surface from a numerical control code, the milling surface having a plurality of grid points, the numerical control code having a position command; (b) calculating a normal vector for each of the plurality of grid points on the milling surface; (c) feeding back a position feedback of each of the plurality of grid points by the electromechanical analysis module, and deriving a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback; (d) calculating a component of the normal vector for the three-axis dynamic position error so as to obtain a normal-vector error value of the corresponding grid point; and, (e) displaying undercutting information of the normal-vector error value of the corresponding grid point on the milling surface.

As stated,

by providing the simulation method for milling by use of a dynamic position error in this disclosure, since the defects on the milling surface of the workpiece and the error values of the normal vector perpendicular to the milling surface are highly related. Empirically, the larger the error value is, the more serious the undercut at the milling surface would be. In this embodiment, the error management by projecting the three-axis dynamic position error to the normal vector on the milling surface can be used to simulate the undercutting. Such a method can provide precision estimates at errors, machining outcome and positions, thus the error caused by the structuring of the machine tool can be easily noticed, the error values on the milling surface can be clearly observed, possible cutting defects along the machining path can be alerted prior to a real cutting, and the cutting prints can be easily observed along the machining path.

Further, the simulation method for milling by use of a dynamic position error provided by this disclosure can reduce the complicated computation upon the material removal by crossing spatially the cutting tool and the workpiece. Also, by applying dot product to produce the three-axis dynamic position errors with the corresponding normal vector on the milling surface, the normal-vector error values can be obtained with an enhanced simulation speed.

In addition, the method provided by this disclosure can locate the maximum error values in the same machining method, and thus further improvement upon the machining method can be easily carried out.

In addition, this disclosure can further evaluate different machining error values among various machining methods to determine a preferable machining path, or to judge the effects from different machining variables, such that the object of determining a better machining method for specific products can be achieved.

Further scope of applicability of the present application will become more apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating exemplary embodiments of the disclosure, are given by way of illustration only, since various changes and modifications within the spirit and scope of the disclosure will become apparent to those skilled in the art from this detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will become more fully understood from the detailed description given herein below and the accompanying drawings which are given by way of illustration only, and thus are not limitative of the present disclosure and wherein:

FIG. 1 is a flowchart of an embodiment of the simulation method for milling by use of a dynamic position error in accordance with this disclosure;

FIG. 2A is a schematic view of an embodiment of the numerical control code in accordance with this disclosure;

FIG. 2B shows schematically data of a node point within the numerical control code of FIG. 2A;

FIG. 3A is a schematic view of an embodiment of the 2D grid in accordance with this disclosure;

FIG. 3B shows schematically the 2D grid of FIG. 3A in an interpolation process;

FIG. 4A demonstrates schematically an embodiment of X coordinates of the grid of a milling surface in accordance with this disclosure;

FIG. 4B demonstrates schematically an embodiment of Y coordinates of the grid of a milling surface in accordance with this disclosure;

FIG. 4C demonstrates schematically an embodiment of Z coordinates of the grid of a milling surface in accordance with this disclosure;

FIG. 5 shows schematically an embodiment of the milling surface in accordance with this disclosure;

FIG. 6A shows schematically a search in the 2D grid of FIG. 3A;

FIG. 6B shows schematically a normal vector of a grid point of FIG. 6A;

FIG. 7A demonstrates schematically an embodiment of X-directional components of the normal vectors in accordance with this disclosure;

FIG. 7B demonstrates schematically an embodiment of Y-directional components of the normal vectors in accordance with this disclosure;

FIG. 7C demonstrates schematically an embodiment of Z-directional components of the normal vectors in accordance with this disclosure;

FIG. 8 shows schematically an embodiment of the position feedbacks and the corresponding three-axis dynamic position errors in accordance with this disclosure;

FIG. 9 shows schematically three-axis dynamic position errors for components of a normal vector at the milling surface of FIG. 5;

FIG. 10 shows schematically an embodiment of sampling the three-axis dynamic position errors from grid points in accordance with this disclosure;

FIG. 11 demonstrates schematically an embodiment of errors of normal vectors of grid points in accordance with this disclosure;

FIG. 12A shows schematically normal-vector errors in an embodiment of the milling surface in accordance with this disclosure;

FIG. 12B shows schematically corresponding numerical values of the normal-vector errors of FIG. 12A; and

FIG. 13 is a flowchart of another embodiment of the simulation method for milling by use of a dynamic position error in accordance with this disclosure.

DETAILED DESCRIPTION

In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the disclosed embodiments. It will be apparent, however, that one or more embodiments may be practiced without these specific details. In other instances, well-known structures and devices are schematically shown in order to simplify the drawing.

Referring to FIG. 1, a flowchart of an embodiment of the simulation method for milling by use of a dynamic position error in accordance with this disclosure is shown. In this embodiment, the simulation method for milling by use of a dynamic position error S10 can be fulfilled via hardware (such as processors, computers or mainframes), software (such as program codes performed by processors) or a relevant combination of software and hardware. In other words, this disclosure can be a software program that can utilize a processor or a computer to connect a controller of a machine tool to perform program codes in the processor (i.e., the simulation method for milling by use of a dynamic position error of this disclosure), so that a corresponding machining simulation can be performed upon the machine tool. In this embodiment, the simulation method for milling by use of a dynamic position error S10 includes Step S11 top Step S15. Firstly, Step S11 is performed. A numerical control code is utilized to generate a milling surface. In other words, 3D coordinate data of the numerical control code is used to plot a model resembling to a real workpiece. It shall be explained that the numerical control code (NC code) herein is to control machining steps of the machine tool. Namely, a cutting tool of the machine tool follows a predetermined machining path defined by the numerical control code to perform machining upon a workpiece according to a specific work order.

Refer now to FIG. 2A and FIG. 2B; where FIG. 2A is a schematic view of an embodiment of the numerical control code in accordance with this disclosure, and FIG. 2B shows schematically data of a node point within the numerical control code of FIG. 2A. As shown, the numerical control code is consisted of a plurality single node points P. Each of the single node points P in the numerical control code includes a program line number, a machining command and a position command. It shall be explained that the term “position command” herein stands for 3D coordinate data for three axes of the machine tool on the machining path; i.e. X-axis coordinate, Y-axis coordinate and Z-axis coordinate. For example, as shown in the highlight square of FIG. 2B, X39.48967 tells that the X-axis coordinate is 39.48967, Y−40.73029 tells that the Y-axis coordinate is −40.73029, and Z−6.81824 tells that the Z-axis coordinate is −6.81824. In addition, the aforesaid coordinates for the single node point are raised for a explanation purpose only, not for limiting the scope of applications of this disclosure.

For the numerical control code to generate a milling surface in Step S11, following steps shall be executed. Firstly, the X-axis coordinates, the Y-axis coordinates and the Z-axis coordinates of the position commands in the numerical control code shall be read. Then, refer now to FIG. 3A and FIG. 3B; where FIG. 3A is a schematic view of an embodiment of the 2D grid in accordance with this disclosure, and FIG. 3B shows schematically the 2D grid of FIG. 3A in an interpolation process. On the 2D plane expanded by the X axis and the Y axis, based on the range of the X coordinates and the range of the Y coordinates in the position commands of the numerical control code, a 2D grid G can be organized. In a relationship between the 2D grid G and the numerical control code, X coordinates of all the single node points in the numerical control code fall within the aforesaid range of the X coordinates, and Y coordinates of all the single node points in the numerical control code fall within the aforesaid range of the Y coordinates. For example, as shown in FIG. 3A and FIG. 3B, for the coordinate points Z1 and Z2 in the numerical control code, the corresponding X coordinates and Y coordinates are all fallen within the aforesaid range of the X coordinates and that of the Y coordinates for the 2D grid G of FIG. 3A, in which the grid point P00 tells that the corresponding grid number is (0, 0), and the grid point P01 tells that the corresponding grid number is (0, 1). In other words, after the numerical control code is obtained, then distributions of all the single node points can be realized. Further, the range of the X coordinates and that of the Y coordinates for the 2D grid G can be also understood. In addition, a graph unit D can be equal to a single node length of the numerical control code. In other words, a length between the grid points P00 and P01 is equal to the single node length between two neighboring single node points P.

Then, referring to the X coordinates and the Y coordinates of the position commands of the numerical control code, an interpolation process can be applied to add in the corresponding Z coordinates in the respective position commands of the 2D grid G, such that a 3D milling surface can be formed. Namely, the milling surface is established in accordance with a plurality of grid points. In establishing the 3D grid for the milling surface, interpolation calculations might be needed. For example, as shown in 3B, coordinate points Z1, Z2 on the 3D grid (the milling surface) have respective X-axis coordinates, falling to two opposite sides of 2D grid point P10. Then, the Z-axis coordinate ZP for the grid point P10 can be obtained by an interpolation algorithm by evaluating the X-axis coordinates of Z1, ZP, Z2 and the Z-axis coordinates of Z1, Z2. In particular, in this example, since only to grid points Z1, Z2 are used to interpolate the grid point ZP, thus only a linear interpolation can be applied. If more data can be involved to perform the interpolation, then a second or higher order fitting curve can be also applied to carry out the interpolation of this disclosure. Since the interpolation algorithm is well known in the art, thus details thereabout are omitted herein.

Refer now to FIG. 4A to FIG. 4C; where FIG. 4A demonstrates schematically an embodiment of X coordinates of the grid of a milling surface in accordance with this disclosure, FIG. 4B demonstrates schematically an embodiment of Y coordinates of the grid of a milling surface in accordance with this disclosure, and FIG. 4C demonstrates schematically an embodiment of Z coordinates of the grid of a milling surface in accordance with this disclosure. By having Grid number (5, 5) as an example (highlighted by a square in the figure), the X-axis coordinate is −39.0903, the Y-axis coordinate is −40.3298, and the Z-axis coordinate is −3.5682 after the interpolation process. Thereupon, a 3D grid for the milling surface can be obtained. Referring back to FIG. 3B, after necessary interpolation processes, all the Z's can be connected to form a curve L3. Similarly, by expanding along the Y axis, more curves parallel to L3 spatially can be obtained according to the formulation described above. Thus, by connecting all the curves, a curved surface can be obtained, and this surface is the milling surface F1 (FIG. 5). Referring now to FIG. 5, an embodiment of the milling surface in accordance with this disclosure is schematically shown. Upon the aforesaid arrangement, by utilizing the numerical control code, the milling surface F1 for a model can be obtained to fit a real workpiece, and this milling surface F1 can be used much conveniently for calculating the normal vectors or displaying the stimulation results.

In this embodiment, after Step S11 is performed to generate the milling surface by utilizing the numerical control code, then S12 is performed to calculate a normal vector of each grid point on the milling surface. Step S12 can be performed step by step as follows. Firstly, at least two vectors are located for each grid point. Then, these two vectors are crossed to obtain a corresponding normal vector for the respective grid point. Refer now to FIG. 6A and FIG. 6B; where FIG. 6A shows schematically a search in the 2D grid of FIG. 3A, FIG. 6B shows schematically a normal vector of a grid point of FIG. 6A. In calculating the normal vector for the grid point P22, four grid points P12, P21, P32, P23 surrounding the grid point P22 are located. Then, along the Y axis passing the grid point P22, a first normal vector U is formed by connecting the two grid points P21 and P23. On the other hand, along the X axis passing the grid point P22, a second normal vector V is formed by connecting the two grid points P12 and P32, in which the second vector V is not collinear or parallel to the first vector U. Then, a normal vector N can be obtained by applying cross product upon the first normal vector U and the second normal vector V. It shall be explained that, for a concise purpose, FIG. 6A and FIG. 6B raise example in the 2D grid G. However, it shall be understood that, through the aforesaid Step S11, each of the grid points can be in correspondence with an X-axis coordinate, a Y-axis coordinate and a Z-axis coordinate according to the respective position command of the numerical control code. Thereupon, a 3D grid can be formed, and each of the grid points in the 3D grid can locate a normal vector according to the aforesaid vector method. Refer now to FIG. 7A to FIG. 7C; where FIG. 7A demonstrates schematically an embodiment of X-directional components of the normal vectors in accordance with this disclosure, FIG. 7B demonstrates schematically an embodiment of Y-directional components of the normal vectors in accordance with this disclosure, and FIG. 7C demonstrates schematically an embodiment of Z-directional components of the normal vectors in accordance with this disclosure. By having Grid number (5,5) as an example (highlighted by a square in the figure), according to Step S12, the X-directional component of the normal vector is 0, the Y-directional component of the normal vector is close to 0, and the Z-directional component of the normal vector is 1.

In this embodiment, after Step S12 is applied to calculate the normal vector for each of the grid points on the milling surface, then Step S13 is performed to feed back a position feedback of each grid point by a controller of a machine tool, and to derive a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback. In this embodiment, the controller of the machine tool is connected with an optical rule or a linear scale, as a linear encoder, for measuring displacements of the cutting tool through photo sensing. The measured displacement is then transmitted to the controller of the machine tool for being monitored, analyzed and displayed. With the aforesaid optical rule, the numerical control code can be loaded into the controller of the machine tool, so that, during the machining process, the optical rule in the controller of the machine tool can feed back a position feedback of each grid point. It shall be explained that the position feedback is the 3D coordinate data of the real position of the machine tool fed back by the optical rule in the controller of the machine tool; i.e., the X-axis coordinate, the Y-axis coordinate and the Z-axis coordinate. Then, based on the position command and the corresponding position feedback, a three-axis dynamic position error of the milling surface can be obtained. In other words, through the optical rule to feed back the real 3D coordinate data of the machine tool, error values of the output position with 3D coordinate data of the position command of the numerical control code loaded into the controller of the machine tool can be obtained; i.e., the three-axis dynamic position errors with respect to the X-axis coordinate, the Y-axis coordinate and the Z-axis coordinate. Referring now to FIG. 8, an embodiment of the position feedbacks and the corresponding three-axis dynamic position errors in accordance with this disclosure is schematically shown. As shown in FIG. 8, for each single time, the optical rule in the controller of the machine tool can feed back a position feedback PB of each grid point. Then, the controller of the machine tool can evaluate the position command and the corresponding position feedback to realize a three-axis dynamic position error EB of the milling surface. In FIG. 8, ERR X stands for the dynamic error value of the X-axis coordinate, ERR Y stands for the dynamic error value of the Y-axis coordinate, and ERR Z stands for the dynamic error value of the Z-axis coordinate.

In this embodiment, after Step S13 is performed to obtain the three-axis dynamic position errors on the milling surface, then Step S14 is performed to calculate a component of the normal vector for the three-axis dynamic position error so as to obtain a normal-vector error value of the grid point. Referring now to FIG. 9, three-axis dynamic position errors for components of a normal vector at the milling surface of FIG. 5 are schematically shown. In Step S13, the three-axis dynamic position errors of the milling surface include the dynamic error value ERR X of the X-axis coordinate, the dynamic error value ERR Y of the Y-axis coordinate, and the dynamic error value ERR Z of the Z-axis coordinate. On the milling surface F1 of Step S12, error values of the normal vector at a grid point of machining path on the milling surface F1 can be obtained by product of the corresponding normal vector N and the three-axis dynamic position errors (i.e., the dynamic error value ERR X of the X-axis coordinate, the dynamic error value ERR Y of the Y-axis coordinate, and the dynamic error value ERR Z of the Z-axis coordinate). These error values are the undercuts in three axial directions. In other words, since the defects on the milling surface of the workpiece and the error values of the normal vector perpendicular to the milling surface are highly related. Empirically, the larger the error value is, the more serious the undercut at the milling surface would be. In this embodiment, the error management of projecting the three-axis dynamic position error to the normal vector on the milling surface can be used to simulate the undercutting, thereby the error caused by the structuring of the machine tool can be noticed, and the error values on the milling surface can be easily observed.

In one embodiment, since the data points of the three-axis dynamic position error output by the controller of the machine tool are generally distributed much denser than the grid points of the milling surface. In other words, the controller of the machine tool can read and output more data points of the three-axis dynamic position errors than the data points displayed by the grid points of the milling surface. Thus, in the aforesaid step of applying dot product to produce the three-axis dynamic position errors (i.e., the dynamic error value ERR X of the X-axis coordinate, the dynamic error value ERR Y of the Y-axis coordinate, and the dynamic error value ERR Z of the Z-axis coordinate) and the normal vector N of every grid point on the milling surface F1, a further step is included. This step is to locate the maximal normal-vector error value among the three-axis dynamic position errors of the grid points within a sampling section, so that loss of data points of the three-axis dynamic position errors can be substantially reduced. Also, the normal-vector error value that can best represent the grid point within a sampling section (i.e., the undercut) can be obtained.

Referring now to FIG. 10, an embodiment of sampling the three-axis dynamic position errors from grid points in accordance with this disclosure is schematically shown. In the upper portion of FIG. 10, 3 grid points on the milling surface are schematically shown; i.e., a first grid point P1, a second grid point P2 and a third grid point P3. The graph unit D is there to separate the first grid point P1 from the second grid point P2, and also to separate the second grid point P2 from the third grid point P3. In the lower portion of FIG. 10, 9 data points of the three-axis dynamic position errors outputted from the controller of the machine tool are aligned; i.e., the data points C1-C9. From FIG. 10, the first grid point P1 can be respective to data point C1 of the three-axis dynamic position errors, the second grid point P2 can be respective to data point C5 of the three-axis dynamic position errors, and the third grid point P3 can be respective to data point C9 of the three-axis dynamic position errors. Data points C2-C4 are located between the first grid point P1 and the second grid point P2, while data points C6-C8 are located between the second grid point P2 and the third grid point P3. By having the second grid point P2 as an example, also by having the second grid point P2 as a center, and by having ½ graph unit D as the sampling range, then the sampling section would be the RD as shown in FIG. 10. The sampling section RD includes data point C3, data point C4, data point C5, data point C6 and data point C7 of the three-axis dynamic position errors. Then, data point C3, data point C4, data point C5, data point C6 sand data point C7 of the three-axis dynamic position errors are individually produced with the normal vector of the second grid point P2. Then, the maximum of these dot products is picked to represent the normal-vector error value of the second grid point P2. Referring now to FIG. 11, an embodiment of errors of normal vectors of grid points in accordance with this disclosure is schematically shown. By having Grid number (5, 5) as an example, the normal-vector error value is 2.2204e−15.

In this embodiment, after Step S14 is performed to obtain the normal-vector error value for each grid point on the milling surface, then Step S15 is performed to display undercutting information of the normal-vector error value of the corresponding grid point on the milling surface. Refer now to FIG. 12A and FIG. 12B; where FIG. 12A shows schematically normal-vector errors in an embodiment of the milling surface in accordance with this disclosure, and FIG. 12B shows schematically corresponding numerical values of the normal-vector errors of FIG. 12A. It shall be explained that, for a concise purpose, a portion of the milling surface in the Y-axial direction of FIG. 12A is adopted for further explanation. In this embodiment, the normal-vector error values of the individual grid points on the milling surface from Step S14 are sorted according to the sections of the normal-vector error value shown in FIG. 12B. For example, the normal-vector error value within the first section R1 is larger than that within the second section R2, and that within the third section R3. In addition, the normal-vector error value within the second section R2 is larger than that within the third section R3. In FIG. 12A, different colors or densities can be assigned to respective sections in FIG. 12B, and also on the milling surface of FIG. 12A. For example, the normal-vector error values for the milling sections B1-B5 on the milling surface of FIG. 12A are respective to the normal-vector error values in the first section R1 of FIG. 12B, with the values larger than 10. Namely, each of the normal-vector error values for the milling sections B1-B5 is larger than 10. A positive error value stands for a swallow cutting, i.e., might be an insufficient cutting. On the other hand, the normal-vector error values for the milling sections Q1-Q5 on the milling surface of FIG. 12A are respective to the normal-vector error values in the third section R3 of FIG. 12B, with the values less than −10. Namely, each of the normal-vector error values for the milling sections Q1-Q5 is less than −10. A negative error value stands for a deep cutting, i.e., might be an excessive cutting (undercut). In other words, by providing this embodiment, the undercut information can be displayed on the milling surface, possible cutting defects along the machining path can be alerted prior to a real cutting, and the cutting prints can be easily observed along the machining path.

Referring now to FIG. 13, a flowchart of another embodiment of the simulation method for milling by use of a dynamic position error in accordance with this disclosure is schematically shown. It shall be explained that the simulation method for milling by use of a dynamic position error S20 of FIG. 13 and the simulation method for milling by use of a dynamic position error S10 of FIG. 1 are largely the same in most of the steps. The steps having the same numbers are basically the same for the two embodiments S10, S20, and thus details for those steps would be omitted herein. On the other hand, the difference between the two embodiments S10, S20 is that the embodiment S20 has a step S23 to replace the step S13 of the embodiment S10 of FIG. 1. In embodiment S20, after Step 12 is performed to calculate a normal vector of each grid point on the milling surface, then Step S23 is performed to feed back a position feedback of each grid point by an electromechanical analysis module, and to derive a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback.

In this embodiment, the controller of the machine tool is connected with an electromechanical analysis module. The electromechanical analysis module can establish a kinematic equations for characterizing motions of the platform, the motor, the screw bar, the bearing and related components on the machine tool. This kinematic equation is realized to further establish a machine tool servo control model including generally a current loop, a speed loop and a position loop in an overlapping manner. The position loop includes the current loop and the speed loop, and the speed loop includes the current loop. With the inclusion of the electromechanical analysis module, the electromechanical analysis module can receive the position commands in the numerical control code loaded from the controller of the machine tool and a machine-tool error, in which the machine-tool error can be position an error of cutting tip or a deformation of screw bar. The position error of cutting tip can be obtained experimentally by a frequency response function (FRF). The electromechanical analysis module in the controller of the machine tool uses the machine tool servo control model to feed back a position feedback of each grid point. It shall be explained that the term “position feedback” herein is the 3D coordinate data of the real position of the machine tool fed back by the electromechanical analysis module in the controller of the machine tool. The electromechanical analysis module receives the position commands and the machine-tool errors. According to the looping model for the machine tool servo control model including the current loop, the speed loop and the position loop, the position feedback can be obtained by simulations. Then, according to the individual position commands and the respective position feedbacks, a three-axis dynamic position error of each grid point on the milling surface can be obtained.

In summary, by providing the simulation method for milling by use of a dynamic position error in this disclosure, since the defects on the milling surface of the workpiece and the error values of the normal vector perpendicular to the milling surface are highly related. Empirically, the larger the error value is, the more serious the undercut at the milling surface would be. In this embodiment, the error management by projecting the three-axis dynamic position error to the normal vector on the milling surface can be used to simulate the undercutting. Such a method can provide precision estimates at errors, machining outcome and positions, thus the error caused by the structuring of the machine tool can be easily noticed, the error values on the milling surface can be clearly observed, possible cutting defects along the machining path can be alerted prior to a real cutting, and the cutting prints can be easily observed along the machining path.

Further, the simulation method for milling by use of a dynamic position error provided by this disclosure can reduce the complicated computation upon the material removal by crossing spatially the cutting tool and the workpiece. Also, by applying dot product to produce the three-axis dynamic position errors with the corresponding normal vector on the milling surface, the normal-vector error values can be obtained with an enhanced simulation speed.

In addition, the method provided by this disclosure can locate the maximum error values in the same machining method, and thus further improvement upon the machining method can be easily carried out.

In addition, this disclosure can further evaluate different machining error values among various machining methods to determine a preferable machining path, or to judge the effects from different machining variables, such that the object of determining a better machining method for specific products can be achieved.

With respect to the above description then, it is to be realized that the optimum dimensional relationships for the parts of the disclosure, to include variations in size, materials, shape, form, function and manner of operation, assembly and use, are deemed readily apparent and obvious to one skilled in the art, and all equivalent relationships to those illustrated in the drawings and described in the specification are intended to be encompassed by the present disclosure. 

What is claimed is:
 1. A simulation method for milling by use of a dynamic position error, applicable to connect a controller of a machine tool, the simulation method comprising the steps of: (a) generating a milling surface from a numerical control code, the milling surface having a plurality of grid points, the numerical control code having a position command; (b) calculating a normal vector for each of the plurality of grid points on the milling surface; (c) feeding back a position feedback of each of the plurality of grid points by the controller of the machine tool, and deriving a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback; (d) calculating a component of the normal vector for the three-axis dynamic position error so as to obtain a normal-vector error value of the corresponding grid point; and (e) displaying undercutting information of the normal-vector error value of the corresponding grid point on the milling surface.
 2. The simulation method for milling by use of a dynamic position error of claim 1, wherein the step (a) includes the steps of: (a1) forming a 2D grid with a range of X coordinates and another range of Y coordinates by utilizing the position command of the numerical control code; and (a2) according to an X coordinate and a Y coordinate of the position command of the numerical control code to obtain a corresponding Z coordinate of the position command by performing interpolation based on the 2D grid to form the milling surface.
 3. The simulation method for milling by use of a dynamic position error of claim 1, wherein the step (b) includes the steps of: (b1) locating at least two vectors for each of the plurality of grid points, the at least two vector passing the corresponding grid point; and (b2) applying cross product to produce the at least two vectors to obtain the normal vector for the corresponding grid point.
 4. The simulation method for milling by use of a dynamic position error of claim 1, wherein the step (d) includes a step of applying dot product to produce the three-axis dynamic position error and the normal vector of the corresponding grid point on the milling surface.
 5. The simulation method for milling by use of a dynamic position error of claim 4, further including a step of locating a maximum of the normal-vector error values from the three-axis dynamic position errors within a sampling section around the corresponding grid point.
 6. A simulation method for milling by use of a dynamic position error, applicable to connect a machine tool, the machine tool further connecting an electromechanical analysis module, the simulation method comprising the steps of: (a) generating a milling surface from a numerical control code, the milling surface having a plurality of grid points, the numerical control code having a position command; (b) calculating a normal vector for each of the plurality of grid points on the milling surface; (c) feeding back a position feedback of each of the plurality of grid points by the electromechanical analysis module, and deriving a corresponding three-axis dynamic position error of the milling surface according to the position command and the position feedback; (d) calculating a component of the normal vector for the three-axis dynamic position error so as to obtain a normal-vector error value of the corresponding grid point; and (e) displaying undercutting information of the normal-vector error value of the corresponding grid point on the milling surface.
 7. The simulation method for milling by use of a dynamic position error of claim 6, wherein the step (a) includes the steps of: (a1) forming a 2D grid with a range of X coordinates and another range of Y coordinates by utilizing the position command of the numerical control code; and (a2) according to an X coordinate and a Y coordinate of the position command of the numerical control code to obtain a corresponding Z coordinate of the position command by performing interpolation based on the 2D grid to form the milling surface.
 8. The simulation method for milling by use of a dynamic position error of claim 6, wherein the step (b) includes the steps of: (b1) locating at least two vectors for each of the plurality of grid points, the at least two vector passing the corresponding grid point; and (b2) applying cross product to produce the at least two vectors to obtain the normal vector for the corresponding grid point.
 9. The simulation method for milling by use of a dynamic position error of claim 6, wherein the step (d) includes a step of applying dot product to produce the three-axis dynamic position error and the normal vector of the corresponding grid point on the milling surface.
 10. The simulation method for milling by use of a dynamic position error of claim 9, further including a step of locating a maximum of the normal-vector error values from the three-axis dynamic position errors within a sampling section around the corresponding grid point.
 11. The simulation method for milling by use of a dynamic position error of claim 6, wherein the step (c) includes the steps of: (c1) establishing a machine tool servo control model including a current loop, a speed loop and a position loop; and (c2) the electromechanical analysis module according to the position command of the numerical control code and a machine-tool error to obtain the position feedback of each of the plurality of grid points, the machine-tool error including a position error of a cutting tip or a deformation of a screw bar. 